home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pccts / dlgdefh.fix < prev    next >
Text File  |  1993-07-19  |  4KB  |  95 lines

  1. /* dlg2.h
  2.  * Things in scanner produced by dlg that should be visible to the outside
  3.  * world
  4.  *
  5.  * SOFTWARE RIGHTS
  6.  *
  7.  * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
  8.  * Set (PCCTS) -- PCCTS is in the public domain.  An individual or
  9.  * company may do whatever they wish with source code distributed with
  10.  * PCCTS or the code generated by PCCTS, including the incorporation of
  11.  * PCCTS, or its output, into commerical software.
  12.  * 
  13.  * We encourage users to develop software with PCCTS.  However, we do ask
  14.  * that credit is given to us for developing PCCTS.  By "credit",
  15.  * we mean that if you incorporate our source code into one of your
  16.  * programs (commercial product, research project, or otherwise) that you
  17.  * acknowledge this fact somewhere in the documentation, research report,
  18.  * etc...  If you like PCCTS and have developed a nice tool with the
  19.  * output, please mention that you developed it using PCCTS.  In
  20.  * addition, we ask that this header remain intact in our source code.
  21.  * As long as these guidelines are kept, we expect to continue enhancing
  22.  * this system and expect to make other tools available as they are
  23.  * completed.
  24.  *
  25.  * ANTLR 1.06
  26.  * Will Cohen
  27.  * Purdue University
  28.  * 1989-1992
  29.  */
  30.  
  31. struct zzdlg_state {
  32.     FILE *stream;
  33.     int (*func_ptr)();
  34.     int lookc;
  35.     int char_full;
  36.     int begcol, endcol;
  37.     int line;
  38. };
  39.  
  40. #ifdef __STDC__
  41. extern char    *zzlextext;      /* text of most recently matched token */
  42. extern char    *zzbegexpr;    /* beginning of last reg expr recogn. */
  43. extern char    *zzendexpr;    /* beginning of last reg expr recogn. */
  44. extern int    zzbufsize;    /* how long zzlextext is */
  45. extern int    zzbegcol;    /* column that first character of token is in*/
  46. extern int    zzendcol;    /* column that last character of token is in */
  47. extern int    zzline;        /* line current token is on */
  48. extern int    zzchar;        /* character to determine next state */
  49. extern int    zzbufovf;    /* indicates that buffer too small for text */
  50.  
  51. /* functions */
  52. extern void    zzadvance();
  53. extern void    (*zzerr)(char *);/* pointer to error reporting function */
  54. extern void    zzskip();    /* erase zzlextext, look for antoher token */
  55. extern void    zzmore();    /* keep zzlextext, look for another token */
  56. extern void    zzmode(int k);    /* switch to automaton 'k' */
  57. extern void    zzrdstream(FILE *);/* what stream to read from */
  58. extern void    zzclose_stream();/* close the current input stream */
  59. extern void    zzrdfunc(int (*)());/* what function to get char from */
  60. extern void    zzgettok();    /* get next token */
  61. extern void    zzreplchar(char c);/* replace last recognized reg. expr. with
  62.                     a character */
  63. extern void    zzreplstr(char *s);/* replace last recognized reg. expr. with
  64.                     a string */
  65. extern void zzsave_dlg_state(struct zzdlg_state *);
  66. extern void zzrestore_dlg_state(struct zzdlg_state *);
  67. #else
  68. extern char    *zzlextext;      /* text of most recently matched token */
  69. extern char    *zzbegexpr;    /* beginning of last reg expr recogn. */
  70. extern char    *zzendexpr;    /* beginning of last reg expr recogn. */
  71. extern int    zzbufsize;    /* how long zzlextext is */
  72. extern int    zzbegcol;    /* column that first character of token is in*/
  73. extern int    zzendcol;    /* column that last character of token is in */
  74. extern int    zzline;        /* line current token is on */
  75. extern int    zzchar;        /* character to determine next state */
  76. extern int    zzbufovf;    /* indicates that buffer too small for text */
  77.  
  78. /* functions */
  79. extern void    zzadvance();
  80. extern void    (*zzerr)();    /* pointer to error reporting function */
  81. extern void    zzskip();    /* erase zzlextext, look for antoher token */
  82. extern void    zzmore();    /* keep zzlextext, look for another token */
  83. extern void    zzmode(/*k*/);    /* switch to automaton 'k' */
  84. extern void    zzrdstream();    /* what stream to read from */
  85. extern void    zzclose_stream();/* close the current input stream */
  86. extern void    zzrdfunc();    /* what function to get char from */
  87. extern void    zzgettok();    /* get next token */
  88. extern void    zzreplchar();    /* replace last recognized reg. expr. with
  89.                     a character */
  90. extern void    zzreplstr();    /* replace last recognized reg. expr. with
  91.                     a string */
  92. extern void zzsave_dlg_state();
  93. extern void zzrestore_dlg_state();
  94. #endif
  95.